1 /* 2 * Copyright 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @file data_space.h 19 */ 20 21 module android.ndk.data_space; 22 23 import arsd.jni; 24 import android.ndk; 25 26 extern (C): 27 nothrow: 28 @nogc: 29 30 /** 31 * ADataSpace. 32 */ 33 enum ADataSpace 34 { 35 /** 36 * Default-assumption data space, when not explicitly specified. 37 * 38 * It is safest to assume the buffer is an image with sRGB primaries and 39 * encoding ranges, but the consumer and/or the producer of the data may 40 * simply be using defaults. No automatic gamma transform should be 41 * expected, except for a possible display gamma transform when drawn to a 42 * screen. 43 */ 44 ADATASPACE_UNKNOWN = 0, 45 46 /** 47 * scRGB linear encoding: 48 * 49 * The red, green, and blue components are stored in extended sRGB space, 50 * but are linear, not gamma-encoded. 51 * The RGB primaries and the white point are the same as BT.709. 52 * 53 * The values are floating point. 54 * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits. 55 * Values beyond the range [0.0 - 1.0] would correspond to other colors 56 * spaces and/or HDR content. 57 */ 58 ADATASPACE_SCRGB_LINEAR = 406913024, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED 59 60 /** 61 * sRGB gamma encoding: 62 * 63 * The red, green and blue components are stored in sRGB space, and 64 * converted to linear space when read, using the SRGB transfer function 65 * for each of the R, G and B components. When written, the inverse 66 * transformation is performed. 67 * 68 * The alpha component, if present, is always stored in linear space and 69 * is left unmodified when read or written. 70 * 71 * Use full range and BT.709 standard. 72 */ 73 ADATASPACE_SRGB = 142671872, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL 74 75 /** 76 * scRGB: 77 * 78 * The red, green, and blue components are stored in extended sRGB space, 79 * and gamma-encoded using the SRGB transfer function. 80 * The RGB primaries and the white point are the same as BT.709. 81 * 82 * The values are floating point. 83 * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits. 84 * Values beyond the range [0.0 - 1.0] would correspond to other colors 85 * spaces and/or HDR content. 86 */ 87 ADATASPACE_SCRGB = 411107328, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED 88 89 /** 90 * Display P3 91 * 92 * Use same primaries and white-point as DCI-P3 93 * but sRGB transfer function. 94 */ 95 ADATASPACE_DISPLAY_P3 = 143261696, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL 96 97 /** 98 * ITU-R Recommendation 2020 (BT.2020) 99 * 100 * Ultra High-definition television 101 * 102 * Use full range, SMPTE 2084 (PQ) transfer and BT2020 standard 103 */ 104 ADATASPACE_BT2020_PQ = 163971072 // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL 105 } 106 107 // ANDROID_DATA_SPACE_H